<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<c:choose>
	<c:when test="${ sessionScope.user ne null}">
		欢迎您:${ user.user_name }上次登陆时间${ sdf.format(user.user_date) }
		<a href="Logout?user=user">注销</a>
	</c:when>
	<c:otherwise>
	欢迎使用!请登录<a href='register.jsp'>注册账号</a>
	<form action="UserLogin" method="post">
		请输入账号:<input type="text" name="username" /><br/>
		请输入密码:<input type="password" name="userpwd"  /><br/>
		<select name="validity">
			<option value="0">无</option>
			<option value="1">一天</option>
			<option value="3">三天</option>
			<option value="7">一周</option>
			<option value="30">一月</option>
		</select>免登陆
		<input type="submit" value="登陆" />
		<input type="reset" value="重置" />
	</form>
	</c:otherwise>
	</c:choose>
</body>
</html>